package coder.nav.handler;

import coder.nav.common.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常捕获
 * @author Bosen 2024/10/30 10:29
 */
@Slf4j
@RestControllerAdvice
public class NavExceptionHandler {

    /**
     * 全局异常信息
     * @author Bosen 2022/11/24 17:35
     **/
    @ExceptionHandler(Exception.class)
    public R handleException(Exception ex) {
        return new R(ex);
    }

}
